﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ibuddylib {

    /// <summary>
    /// A virtual buddy that represents the first (and any) 
    /// i-Buddy it can find connected to the computer
    /// </summary>
    /// <remarks>
    /// It is a separate class so you can keep a reference to an
    /// instance of the anybuddy, and not have to worry about references 
    /// when buddies enter and leave the system.
    /// </remarks>
    class AnyBuddy : IBuddy {
        private BuddyManager manager;

        internal AnyBuddy(BuddyManager manager) {
            this.manager = manager;
        }

        #region IBuddy Members

        public WingPosition WingPosition {
            get {
                return manager.FirstBuddy.WingPosition;
            }
            set {
                manager.FirstBuddy.WingPosition = value;
            }
        }

        public HeadColor HeadColor {
            get {
                return manager.FirstBuddy.HeadColor;
            }
            set {
                manager.FirstBuddy.HeadColor = value;
            }
        }

        public HeartLight HeartLight {
            get {
                return manager.FirstBuddy.HeartLight;
            }
            set {
                manager.FirstBuddy.HeartLight = value;
            }
        }

        public TorsoYaw TorsoYaw {
            get {
                return manager.FirstBuddy.TorsoYaw;
            }
            set {
                manager.FirstBuddy.TorsoYaw = value;
            }
        }

        public void BeginUpdate() {
            manager.FirstBuddy.BeginUpdate();
        }

        public void EndUpdate() {
            manager.FirstBuddy.EndUpdate();
        }

        #endregion
    }
}
